<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import = "jdbc.*" %>
<%@ page import = "java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
<%

JdbcDao mysql = new JdbcDao();

//课程接口
//mysql.newClass("3", "java小学期", "3", "许斌", 100, "2014-9-25");
//mysql.chooseClass("gb1@qq.com", "123");
//mysql.delClass("123");
//List<HashMap<String, String>> hm = mysql.searchClassByNumber("1");
//List<HashMap<String, String>> hm = mysql.searchClassByName("java");
//out.println(hm.toString());


out.println(mysql.postArticle("java小学期", "gb12@mail.com", "java小学期太难了", 0));
mysql.postArticle("java大作业太难了", "gb13@mail.com", "RT，跪求助教降低难度", 0);
mysql.postArticle("java大作业太难了", "gb13@mail.com", "转义字符串测试''''''''\"\"\"", 0);
for (int i = 0; i < 4; ++i)
	mysql.postArticle("java小学期", "gb" + i + "@mail.com", "顶楼上", 1);
for (int i = 0; i < 4; ++i)
	mysql.postArticle("java小学期", "gb" + i + "@mail.com", "顶楼上", 2);

HashMap<String, String> hm = mysql.getArticleInfo(3);
out.println(hm.toString() + "<br>");
out.println("<br>");out.println("<br>");out.println("<br>");

List<HashMap<String, String>> list1 = mysql.getArticleList();
out.println(list1.toString() + "<br>");
out.println("<br>");out.println("<br>");out.println("<br>");

List<HashMap<String, String>> list2 = mysql.searchArticleByCommentto(0);
out.println(list2.toString() + "<br>");
out.println("<br>");out.println("<br>");out.println("<br>");

mysql.changeArticleInfo(3, "tags", "java");

List<HashMap<String, String>> list3 = mysql.searchArticleByTag("java");
out.println(list3.toString() + "<br>");
out.println("<br>");out.println("<br>");out.println("<br>");

%>

	<form action="checkemail.jsp" method="GET">
		<input type="text" name="first_param" /> + <input id="b" type="text"
			name="last_param" /> = <br /> <input type="button"
			value="Calculate" onclick="showValue()" />
		<div id="c"></div>
		<script>
			function showValue() {
				var t1 = document.getElementsByName("first_param").item(0).value;
				var t2 = document.getElementById("b").value;
				var t3 = parseFloat(t1) + parseFloat(t2);
				var c = document.getElementById("c");

				c.innerHTML = t3;
				c.innerHTML += "<br/><input type='text' id='t2' value="+ t3 +" />";
				//document.write(t3);
			}
		</script>
		<br /> <br />
		<input type="submit" value="Submit" />
	</form>
	
	<form action="login.jsp" method="GET">
		<div>login email : <input name = "login_email" type="text"/></div>
		<div>login password : <input name = "login_password" type="password"/></div>
		<br /> <br />
		<input type="submit" value="login" />
	</form>
	<form action="logout.jsp" method="GET">
		<input type="submit" value="logout" />
	</form>
	
	<form action="reg.jsp" method="GET">
		<div>email : <input name = "email" type="text"/></div>
		<div>password : <input name = "password" type="password"/></div>
		<br /> <br />
		<input type="submit" value="regist" />
	</form>
</body>
</html>